package com.xf.system.enums;

/**
 * @author xiefengf
 */
public enum StatusEnum {

    /**
     * value没有对应的枚举类,返回空字符串
     */
    NOT_FOUNT_ENUM("-1",""),
    /**
     * 启用（正常）
     */
    ENABLE("0","正常"),
    /**
     * 停用
     */
    DISABLE("1","停用");


    private String value;

    private String name;

    StatusEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static StatusEnum getByName(String value){
        for(StatusEnum enums: StatusEnum.values()){
            if(enums.getValue().equals(value)){
                return enums;
            }
        }
        return NOT_FOUNT_ENUM;
    }
}
